package com.europe.business.europebusiness.ui.activity;

import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;

import com.europe.business.europebusiness.R;
import com.europe.business.europebusiness.ui.activity.base.BaseActivity;
import com.europe.business.europebusiness.ui.utils.SpUtils;


public class WelcomeActivity extends BaseActivity {

    Handler handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            if(msg.what == 1111){
                String token = SpUtils.getSpStringValue(WelcomeActivity.this, "token");
                if(TextUtils.isEmpty(token)){
                    startAct(LoginActivity.class);
                }else{
                    startAct(MainActivity.class);
                }
            }
            finish();
        }
    };

    @Override
    protected int setLayout() {
        return R.layout.activity_welcome_pic;
    }

    @Override
    protected void initView() {

        handler.sendEmptyMessageDelayed(1111, 3000);
    }
}
